home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / olrdrs / pq214.zip / ANSIART.DOC < prev    next >
Text File  |  1991-08-03  |  32KB  |  745 lines

  1.       POWER-QWK 2.14  August 1991  (c) Gale Green & Powerline Systems Ltd.
  2.  
  3.       This file, and the accompanying programs, form part of the POWER-QWK
  4.       software package. They can ONLY be distributed as part of the
  5.       complete POWER-QWK package. Power-Qwk is SHAREWARE.  Please register
  6.       if you find the software of use.
  7.  
  8.       Ansi Art and Music
  9.       ~~~~~~~~~~~~~~~~~~
  10.       Introduction
  11.       ~~~~~~~~~~~~
  12.       From  release 2.06 onwards, Power-QWK supports  messages  containing
  13.       Ansi  Music  as  well as the conventional  Ansi  colour  and  cursor
  14.       movement  sequences and the Ansi Art files which were  supported  at
  15.       release 2.05.
  16.  
  17.       This  document describes the Escape Sequences permitted by the  ANSI
  18.       standard, as implemented by console drivers such as ANSI.SYS and its
  19.       clones,  and highlights the differences between standard ANSI  files
  20.       and Ansi Art and Music files.
  21.  
  22.       The  ANSI  standard defines Escape Sequences which may  be  embedded
  23.       within Ascii text files to describe various characteristics of  that
  24.       text  which are to be applied to it when it is displayed on a  video
  25.       screen.
  26.  
  27.       The  'characteristics' describe such things as the colour  in  which
  28.       the text is to be displayed, the position on the screen at which the
  29.       text  is  to  be displayed, whether the  text  should  be  standard,
  30.       intense or flashing, and so on.
  31.  
  32.       All  this information is read and used by the video driver  whenever
  33.       the file is displayed.
  34.  
  35.       As  well  as  providing information to the VIDEO  driver  about  the
  36.       formatting  of  subsequent  OUTPUT, the Escape  Sequences  may  also
  37.       contain  instructions  which the video driver must pass  on  to  the
  38.       KEYBOARD driver to tell it how it is to interpret subsequent  INPUT.
  39.       A CONSOLE driver, like ANSI.SYS or one of its clones, embodies  both
  40.       a  video  driver and a keyboard driver so such  information  is  not
  41.       actually passed anywhere but is merely retained by ANSI.SYS when  in
  42.       video mode for later use when in keyboard mode.
  43.  
  44.       An  Escape  Sequence is a series of characters which  always  starts
  45.       with  the  character pair Esc[. That is, the  character  Escape,  or
  46.       Ascii 27, followed by a left bracket.
  47.  
  48.       An Escape Sequence may be terminated by any one of the characters in
  49.       the following list:
  50.  
  51.                  A, B, C, D, H, J, K, R, f, h, l, m, n, p, s, u
  52.  
  53.       Each  of  these  terminators defines a  particular  type  of  Escape
  54.       Sequence,  thus  determining  the action to be taken  by  the  video
  55.       driver  and  defining  what  other  characters  may  appear  in  the
  56.       Sequence, between the Esc[ and the terminator.
  57.  
  58.       With  one exception, an Escape Sequence may not contain any  of  the
  59.       terminator characters except as its last character.
  60.  
  61.       The exception, as we shall see later, is an Ansi Music Sequence.
  62.  
  63.       The next three sections describe the standard Ansi Escape Sequences,
  64.       Ansi Art Escape Sequences and Ansi Music Escape Sequences.
  65.  
  66.  
  67.       Standard Escape Sequences
  68.       ~~~~~~~~~~~~~~~~~~~~~~~~~
  69.       Esc[x;yH       These  each  move  the cursor to row x column y. Rows
  70.       Esc[x;yf       are  numbered from 1 to 25; columns are numbered from
  71.                      1 to  80. x and y each default to 1 if  omitted.
  72.  
  73.                      i.e., Esc[H  or  Esc[f  each move the cursor  to  the
  74.                      Home position (top left hand corner of the screen);
  75.  
  76.       Esc[xA         Moves  the  cursor UP x rows (but not beyond  top  of
  77.                      screen). Cursor column remains unchanged.
  78.  
  79.       Esc[xB         Moves  the cursor DOWN x rows (but not beyond  bottom
  80.                      of screen). Cursor column remains unchanged.
  81.  
  82.       Esc[xC         Moves the cursor RIGHT x columns (but not beyond  the
  83.                      right  hand edge of the screen). Cursor  row  remains
  84.                      unchanged.
  85.  
  86.       Esc[xD         Moves  the cursor LEFT x columns (but not beyond  the
  87.                      left  hand  edge of the screen). Cursor  row  remains
  88.                      unchanged.
  89.  
  90.       Esc[s          Tells the video driver to remember the current cursor
  91.                      position for later recall by Esc[u.
  92.  
  93.       Esc[u          Moves  the  cursor  to the last  position  stored  by
  94.                      Esc[s.
  95.  
  96.       Esc[2J         Clears  the screen and moves the cursor to  the  Home
  97.                      position (top left hand corner of the screen).
  98.  
  99.       Esc[K          Clears  the current row from cursor position  to  the
  100.                      right hand edge of the screen.
  101.  
  102.       Esc[=xh        Set Screen to Mode x.
  103.  
  104.                           mode 0 -  40 by 25 black and white
  105.                                1 -  40 by 25 colour
  106.                                2 -  80 by 25 black and white
  107.                                3 -  80 by 25 colour
  108.                                4 -  320 by 200 colour
  109.                                5 -  320 by 200 black and white
  110.                                6 -  640 by 200 black and white
  111.                                7 -  Set end-of-line wrap ON
  112.  
  113.       Esc[=xl        Reset screen to Mode x. (N.B., the 'l' is lower  case
  114.                      L).
  115.  
  116.                      This is identical to 'Set Screen Mode', above, except
  117.                      that when x is 7 end-of-line wrap is switched OFF.
  118.  
  119.       Esc[?7h        Set end-of-line wrap ON.
  120.  
  121.       Esc[.....m     Set Graphics Rendition
  122.  
  123.                      Between the Esc[ and the m may appear as many of  the
  124.                      numbers in the following list as required,  separated
  125.                      by  semi-colons. The numbers are  processed  strictly
  126.                      left to right.
  127.  
  128.                       0 - reset  to system defaults of White  text,  Black
  129.                           background,  High  Intensity (Bold)  OFF,  Blink
  130.                           OFF.
  131.  
  132.                      The  remaining values only set particular  attributes
  133.                      ON.
  134.  
  135.                      Therefore,  whenever you want to alter  Intensity  or
  136.                      Blink,  you  are  obliged to reset  the  colours  you
  137.                      require at the same time.
  138.  
  139.                       1 - Set High Intensity (Bold) ON.
  140.  
  141.                       5 - Set Blink ON.
  142.  
  143.                       8 - Set Conceal ON (renders the display invisible).
  144.  
  145.                      30 - Black   foreground ON
  146.                      31 - Red     foreground ON
  147.                      32 - Green   foreground ON
  148.                      33 - Yellow  foreground ON
  149.                      34 - Blue    foreground ON
  150.                      35 - Magenta foreground ON
  151.                      36 - Cyan    foreground ON
  152.                      37 - White   foreground ON
  153.  
  154.                      40 - Black   background ON
  155.                      41 - Red     background ON
  156.                      42 - Green   background ON
  157.                      43 - Yellow  background ON
  158.                      44 - Blue    background ON
  159.                      45 - Magenta background ON
  160.                      46 - Cyan    background ON
  161.                      47 - White   background ON
  162.  
  163.                      Examples:
  164.  
  165.                      Esc[45m        set  Magenta  background  leaving  all
  166.                                     other attributes unchanged.
  167.  
  168.                      Esc[0;1;36m    set   Light   Cyan   text   on   Black
  169.                                     background.
  170.  
  171.                      The following sequence displays the word 'Peacock' in
  172.                      high  intensity flashing Blue on a  Cyan  background,
  173.                      starting  at row 10 column 14. As an aid to  clarity,
  174.                      the  character ` (leftward apostrophe) has been  used
  175.                      to represent the Esc character.
  176.  
  177.                      `[0;1;5;34;46m`[10;14HPeacock
  178.  
  179.       Esc[....p      Keyboard  Reassignment (instructions to be passed  to
  180.